home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-10-01 | 6.3 KB | 220 lines | [TEXT/Mrls] |
- Marlais is an implementation of a Dylan-like language.
-
- In the spirit of the Larry Tesler's foreword to the Dylan Book[1],
- Marlais supports a language with multiple syntaxes atop the
- extremely neutral base of Lisp.
-
- The default infix syntax provided by Marlais is based on the description
- of Dylan given in the Dylan Interim Reference Manual (DIRM) [2]. Marlais
- does not implement that language in its entirety, and differs in some
- specific ways noted below.
-
- The alternative prefix syntax is a modification of the syntax defined in
- the Dylan Book. The modifications have been made to support the semantics
- described in the DIRM with as little change as possible.
-
- The Marlais interpreter can be operated in either infix or prefix
- syntax mode. The mode can be changed or asserted during execution by
- use of the built-in methods `infix' and `prefix'. By default, Marlais
- starts in infix syntax mode. To initiate an interpreter session using
- prefix syntax, one may use the '-c' command-line argument.
-
- Here are the major semantic differences between Marlais and the DIRM and
- Dylan Book specification of Dylan.
-
- * Marlais supports modules and evaluates expressions with respect to a
- current-module's namespace. One can get the current module with
-
- current-module ()
-
- and one can set the current module with
-
- set-module (new-module)
-
- * Modules have fledgling support as of version 0.5.3.
- `define module' works with simple use clauses. The following example
- shows the implemented behavior:
-
- Contents of the file foo.dyl:
-
- module: foo
-
- define variable x = 10;
-
- Interpreter session:
-
- Marlais 0.5.3
- ? define module foo
- > use dylan-user, export: all;
- > end;
- ? current-module ();
- foo
- ? set-module (dylan-user);
- ? load ("/tmp/foo.dyl");
- ? current-module ();
- dylan-user
- ? x;
- error: unbound variable: x.
- ? set-module (foo);
- ? x;
- 10
- ? define module uses-foo
- > use foo;
- > end;
- ? current-module ();
- uses-foo
- ? x;
- 10
- ? x := 5;
- 5
- ? set-module (foo);
- ? x;
- 5
- ? set-module (dylan-user);
- ? x;
- error: unbound variable: x.
-
-
- Prefix support for modules:
-
- (define-module module-name clauses_opt)
-
- where
- clauses_opt is one of
- (use used-module-name module-options_opt)
- (export variables)
- (create variables)
-
- module-options is one of
- (import: imports)
- (exclude: variable_names)
- (prefix: string)
- (rename: rename-specs)
- (export: variable-names)
-
- an import is of the form
- variable-name or
- rename-spec
-
- a rename-spec is of form
- (old-variable-name new-variable-name)
-
- * Conditions are not yet implemented in a reasonable way. Condition
- classes exist, but beyond that, there's very little.
-
- * The prefix notation for `for' has been modified as follows:
-
- (`for' (clause- ... clause-n)
- (test result-1 ... result-n)
- expr-1 ... expr-n)
-
- where a clause takes one the following three forms:
-
- (variable init step)
- (`collection:' variable collection)
- (`range:' variable start [{`to' | `above' | `below'} bound]
- [`by' increment])
-
- The behavior of `for' using these forms conforms to the DIRM specification
- of form w.r.t. explicit step clauses, collection clauses, and numeric
- clauses, respectively.
-
- * The `block' control construct is not yet implemented. If
- you REALLY need to bind an exit procedure right now, you can do this
- hackish sort of thing:
-
- bind-exit (signal(), (begin print ("hi"); signal ("ho"); end));
-
- This is ROUGHLY equivalent to the following prefix Dylan code:
-
- (bind-exit (signal) (print "hi") (signal "ho"))
-
- Don't get in the habit of doing this, please, block will be here soon.
-
- * The handler form of `let' is not yet implemented.
-
- * Marlais supports the iteration protocol of the Dylan book [1] (albeit
- somewhat feebly) in addition to the iteration protocol of the DIRM.
-
- * Element setter functions conform to the argument order of the
- original Dylan book [1], i.e.,
-
- element-setter ( object, arg1, ... argn, new-value)
-
- * class initialization argument specifications are not supported.
-
- * Limited integer types *are* supported. (Design Note 6).
-
- * Union Types *are* supported. (Design Note 7).
-
- * Builtin classes - Builtin classes are represented differently from
- classes defined with DEFINE-CLASS and (make <class> ...)
-
- * Incomplete class hierarchy. The collection classes are spotty.
- There is no support for <stretchy-vector>.
-
- * Error handling - There is very little support for error handling and
- conditions. Basically there is just an (error ...) function.
-
- * Numeric operations - Only the numeric operations that I needed were
- included. See the file HACKING for information on adding these
- functions yourself.
-
- * Weak links - Not supported. (See note on pg. 93 of the Dylan book [2].)
-
- * Misc - If there is a feature missing that you need, let us know. It
- will have a better chance of making it into the next release.
-
- There are several additional features that have been added.
-
- * Simple stream I/O - There were only passing allusions to I/O in the
- Dylan book. Marlais has added the following I/O features:
-
- <stream> builtin class
- open-input-file (<string>) => <stream>
- open-output-file (<string>) => <stream>
- close-stream (<stream>) => unspecified
- eof-object? (<object>) => <boolean>
- print (<object>) => unspecified
- princ (<object>) => unspecified
- format ((union <stream> #t) <string> arg1 arg2 ...) => unspecified
- read ([<stream>]) => <object>
- read-char ([<stream>]) => <character>
-
- * Syntax mode and loading Dylan files
-
- infix () => unspecified
- Switch the current syntax mode to infix.
- prefix () => unspecified
- Switch the current syntax mode to prefix.
-
- load (<string>) => unspecified
- Loads a Dylan file containing contents whose syntax
- matches the current syntax mode.
- i-load (<string>) => unspecified
- Loads an infix syntax Dylan file.
- p-load (<string>) => unspecified
- Loads a prefix syntax Dylan file.
-
- * Other handy features
-
- ctime() => <string>
- returns day-date-time string
- time() => <integer>
- returns low order bits of number of seconds since
- some system-defined referent.
- clock() => <integer>
- returns number of milliseconds used by process.
-
- * Leaving Marlais - The functions QUIT and BYE are provided for
- leaving Marlais.
-
- ---
- [1] Andrew Shalit. "Dylan: an object oriented dynamic language".
- Apple Computer, Inc. 1992.
-
- [2] Andrew Shalit, Orca Starbuck, et. al. "Dylan (TM) Interim Reference Manual.
- Apple Computer, Inc. 1992-1994
-
- [3] Various Authors. "Dylan Design Notes". Apple Computer, Inc. 1993-1994.
-